import Field from 'winged/utils/wt-model-field'
import TimeUtils from 'winged/utils/wt-time-utils'
import Vue from 'vue'

export default {
	title: '化验',
	name: 'check',
	tableName: 'check',
	single: false,	
	query: {
		method: 'GET',
		url: 'doctor/patient/surgery',
		transfer: true,
		pagination: true,
		extraParams: [
			'case_id',
		],
		// 在修改的时候需要进行单条记录查询，用于获取关联麻醉记录
		getOnEdit: true
	},
    count: {
        method: 'GET',
        url: 'doctor/patient/surgery/count',
        transfer: true,
        extraParams: [
            'case_id',
        ],
    },
	new: {
		method: 'POST',
		url: 'doctor/patient/surgery',
		transfer: true,
		extraParams: [
			'case_id',
		]
	},
	update: {
		method: 'PUT',
		url: 'doctor/patient/surgery',
		transfer: true
	},
	delete: {
		method: 'DELETE',
		url: 'doctor/patient/surgery',
		transfer: true
	},
	id_field: {
		// 用于修改、删除操作的字段名
		name: 'surgery_id',
		// id字段查询结果中的tableName默认为'id'
		// tableName: 'id'
	},
	fields: [
		{
			label: '患者',
			type: Field.types.text,
			display: true,
			noSave:true,
			summary: true,//用于在概要中显示
			name: 'operator',
			tableName: 'operator',
			formSize: 'small',
			rules: [{ required: true, message: '请填写术者姓名', trigger: 'blur' }]
		},{//列表显示的麻醉名称
			label: 'RH',
			type: Field.types.select,
			multiple: false,
			formSize: 'small',
			allowUseWithoutAdd:true,
			summary: true,//用于在概要中显示
			display: true,
			noSave: false,//在表单中显示本字项
			allowAdd: true,
			name: 'rh', 
			filed: 'rh',
			tableName: 'rh',
			options:[
				{
					label:'阴',
					value:'1'
				},{
					label:'阳',
					value:'2'
				}
			],
			rules: [{ required: true, message: '请选择RH', trigger: 'change' ,type: 'string' }],
		},{
			label: 'ABO',
			type: Field.types.select,
			formSize: 'small',
			display: true,
			summary: true,//用于在概要中显示
			noSave: true,
			options:[
				{
					label:'A',
					value:'1'
				},{
					label:'B',
					value:'2'
				},{
					label:'O',
					value:'3'
				},{
					label:'AB',
					value:'4'
				}
			],
			name:'abo',
			tableName: 'abo'
		}, {
			label: 'infinity-table',
			formSize: 'large',
			type: Field.types.text,
			multiple: false,
			display: true,
			name: 'infinityTable',
			appendComponent:'wt-model-infinity-table',
			tableName: 'infinityTable',
			rules: [{ required: true, message: '请输入术前ESR', trigger: 'change' }]
		},{
			label: '术前ESR',
			formSize: 'small',
			type: Field.types.text,
			multiple: false,
			display: true,
			name: 'beforeESR',
			tableName: 'beforeESR',
			rules: [{ required: true, message: '请输入术前ESR', trigger: 'change' }]
		}, {
			label: '术后ESR',
			formSize: 'small',
			type: Field.types.text,
			multiple: false,
			display: true,
			name: 'afterESR',
			tableName: 'afterESR',
			rules: [{ required: true, message: '请输入术前ESR', trigger: 'change' }]
		}, {
			label: '术前CRP',
			formSize: 'small',
			type: Field.types.text,
			multiple: false,
			display: true,
			name: 'beforesCRP',
			tableName: 'beforesCRP',
			rules: [{ required: true, message: '请输入术前ESR', trigger: 'change' }]
		}, {
			label: '术后CRP',
			formSize: 'small',
			type: Field.types.text,
			multiple: false,
			display: true,
			name: 'afterCRP',
			tableName: 'afterCRP',
			rules: [{ required: true, message: '请输入术前ESR', trigger: 'change' }]
		}, {
			label: 'lgG',
			formSize: 'small',
			type: Field.types.text,
			multiple: false,
			display: true,
			name: 'lgG',
			tableName: 'lgG',
			rules: [{ required: true, message: '请输入lgG', trigger: 'change' }]
		}, {
			label: 'lgA',
			type: Field.types.text,
			formSize: 'small',
			multiple: false,
			display: true,
			name: 'lgA',
			tableName: 'lgA',
			rules: [{ required: true, message: '请输入lgA', trigger: 'change' }]
		}, {
			label: 'lgM',
			formSize: 'small',
			type: Field.types.text,
			multiple: false,
			display: true,
			name: 'lgM',
			tableName: 'lgM',
			rules: [{ required: true, message: '请输入lgM', trigger: 'change' }]
		}, {
			label: 'RAAS',
			formSize: 'small',
			layoutDirection: 'horizontal',//[ horizontal,vertical]
			type: Field.types.select,
			multiple: false,
			display: false,
			name: 'RAAS',
			tableName: 'RAAS',
			value:'',
			options:[
				{
					label:'无',
					value:'RAAS-NON',
					linkedComponent:false
				},{
					label:'术前肾素',
					value:'RAAS-A'
				},{
					label:'术前肾素（激发）',
					value:'RAAS-A+'
				},{
					label:'术前血管紧张术',
					value:'RAAS-B'
				},{
					label:'术前血管紧张术（激发）',
					value:'RAAS-B+'
				},{
					label:'术前胆固醇',
					value:'RAAS-C'
				},{
					label:'术前胆固醇（激发）',
					value:'RAAS-C+'
				},{
					label:'术后肾素',
					value:'RAAS-D'
				},{
					label:'术后肾素（激发）',
					value:'RAAS-D+'
				},{
					label:'术后血管紧张素',
					value:'RAAS-E'
				},{
					label:'术后血管紧张素（激发）',
					value:'RAAS-E+'
				},{
					label:'术后胆固醇',
					value:'RAAS-F'
				},{
					label:'术后胆固醇（激发）',
					value:'RAAS-F+'
				}
			],
			linkedComponent:'el-input',
			rules: [{ required: true, message: 'RAAS', trigger: 'change' }]
		}
	]
}